package com.fire.service.impl;

import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.fire.bo.fly.req.FlyDelReq;
import com.fire.bo.fly.req.FlyListReq;
import com.fire.bo.fly.req.FlyReq;
import com.fire.bo.fly.res.FlyRes;
import com.fire.dao.FlyDao;
import com.fire.service.FlyService;

@Service
public class FlyServiceImpl implements FlyService {

	@Autowired
	private FlyDao flyDao;
	
	@Override
	public FlyReq insertFly(FlyReq bean) throws SQLException {
		flyDao.insertFly(bean);
		return bean;
	}

	@Override
	public void delFly(FlyDelReq bean) throws SQLException {
		flyDao.delFly(bean);
	}

	@Override
	public List<FlyRes> findFlyList(FlyListReq bean) throws SQLException {
		bean.setPage((bean.getPage()-1)*bean.getPageSize());
		return flyDao.findFlyList(bean);
	}

	@Override
	public int findFlyListCount(FlyListReq bean) throws SQLException {
		return flyDao.findFlyListCount(bean);
	}

}
